<template>
  <div class="header">
    <div class="header-left">
      <div class="iconfont back-icon">&#xe624;</div>
    </div>
    <div class="header-input">
      <span class="iconfont">&#xe632;</span>
      输入城市/景点/游玩主题</div>
    <router-link to="/city">
      <!--使用vuex里面的的city-->
    <!--<div class="header-right">{{this.$store.state.city}}-->
    <!--这是用mapState映射出来的city其实和上面一模一样-->
    <div class="header-right">{{this.city}}
    <span class="iconfont arrow-icon">&#xe6aa;</span>
</div>
    </router-link>
  </div>
</template>
<script type="text/ecmascript-6">
  import {mapState} from 'vuex'
  import {mapGetters} from 'vuex'
export default{
  name:'Header',
  computed:{
    ...mapState(['city']),
    ...mapGetters(['dobuleCity'])
  }
}
</script>
<style lang="stylus" scoped>
/*@import "../../../assets/styles/varibles.styl"*/
//如果在css引入其他css就用~@
/*@import "~@/assets/styles/varibles.styl"*/
@import "~styles/varibles.styl"
.header
  display flex;
  line-height: 0.86rem;
  background-color: $bgColor;
  color:#fff;
  .header-left
    width:0.64rem;
    float:left;
    .back-icon
     text-align:center;
  .header-input
    flex:1;
    padding-left: 0.2rem;
    line-height: 0.64rem;
    height: 0.64rem;
    margin-top: 0.12rem;
    margin-left: 0.12rem;
    background-color: #fff;
    border-radius : 0.1rem;
    color:#ccc;
  .header-right
    color:#fff;
    padding: 0 0.1rem;
    min-width: 1.04rem;
    float:right;
    text-align: center;
    .arrow-icon
     font-size 0.24rem;
     margin-left:-0.04rem;
</style>
